<fieldset>
    <legend>Tìm kiếm</legend>
    <form action="<?php echo Utility::getSiteUrl();?>/result/search" method="post">
        <table border="1" style="width: 80%;text-align: center;margin-left: 10%;" cellpadding="3">        
            <tr>
                <td style="width: 200px;">
                    Mã lớp
                </td>
                <td>
                    <input type="text" name="classId" style="width: 90%;" value="<?php echo isset($search['classId'])?$search['classId']:"";?>" />
                </td>
            </tr>
            <tr>
                <td>
                    Tên Môn học
                </td>
                <td>
                    <input type="text" name="subName" style="width: 90%" value="<?php echo isset($search['subName'])?$search['subName']:"";?>"/>
                </td>
            </tr>
            <tr>
                <td>
                    Mã giáo viên
                </td>
                <td>
                    <input type="text" name="lectureId" style="width: 90%" value="<?php echo isset($search['lectureId'])?$search['lectureId']:"";?>"/>
                </td>
            </tr>
            <tr>
                <td>
                    Tên giáo viên
                </td>
                <td>
                    <input type="text" name="lectureName" style="width: 90%" value="<?php echo isset($search['lectureName'])?$search['lectureName']:"";?>" />
                </td>
            </tr>
            <tr>
                <td>
                    Mã sinh viên
                </td>
                <td>
                    <input type="text" name="studentId" style="width: 90%" value="<?php echo isset($search['studentId'])?$search['studentId']:"";?>"/>
                </td>
            </tr>
            <tr>
                <td>
                    Tên sinh viên
                </td>
                <td>
                    <input type="text" name="studentName" style="width: 90%" value="<?php  echo isset($search['studentName'])?$search['studentName']:"";?>"/>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="submit" name="submit" value="Tìm kiếm" />
                    <input type="reset" value="Nhập lại"/>
                </td>
            </tr>
        </table>
    </form>
</fieldset>

    <br /><br />
    <?php
    if(isset($result))
    {
    ?>
    <table border="1" style="width:100%; ">
        <thead>
        <tr>
            <th>Mã lớp</th>
            <th>Tên môn học</th>
            <th>MSSV</th>
            <th>Tên sinh viên</th>
            <th>MSGV</th>
            <th>Tên giảng viên</th>
            <th>Điểm</th>
        </tr>
        </thead>
        <?php
        $size = $result->getSize();
        if($size == 0)
        {
            ?>
            <tr>
                <td colspan="6">không tìm thấy kết quả thỏa mãn</td>
            </tr>
            <?php
        }
        else
        {
            for($i = 0;$i < $size; $i++)
            {
                $row = $result->getRow($i);
                ?>
            <tr>
                <td><?php echo $row->class_id;?></td>
                <td><?php echo $row->subject_name;?></td>
                <td><?php echo $row->student_id;?></td>
                <td><?php echo $row->student_name;?></td>
                <td><?php echo $row->lecture_id;?></td>
                <td><?php echo $row->lecture_name;?></td>
                <td><?php echo $row->student_result;?></td>
            </tr>
                <?php
            }
            ?>
            <tr>
                <td colspan="7" style="text-align:right"><a href="<?php echo Utility::getSiteUrl();?>/result/export">Xuất ra file .doc</a> </td>
            </tr>
            <?php
        }
        ?>
    </table>
    <?php
    }
    ?>